package fixmodel.factory;

import fixmodel.adapter.GooseAdapter;
import fixmodel.base.Quack;
import fixmodel.entity.Goose;
import fixmodel.impl.DuckCall;
import fixmodel.impl.MallardDuck;
import fixmodel.impl.RedHeadDuck;
import fixmodel.impl.RubberDuck;

/**
 * 生产没有被包装的鸭子对象
 * @author yaojianfeng
 */
public class DuckFactory extends AbstractDuckFactory {
    /**
     * 创建绿头鸭
     *
     * @return 绿头鸭
     */
    @Override
    public Quack creatMallardDuck() {
        return new MallardDuck();
    }

    /**
     * 创建红头鸭
     *
     * @return 红头鸭
     */
    @Override
    public Quack creatRedHead() {
        return new RedHeadDuck();
    }

    /**
     * 创建鸭鸣器
     *
     * @return 鸭鸣器
     */
    @Override
    public Quack creatDuckCall() {
        return new DuckCall();
    }

    /**
     * 创建橡皮鸭
     *
     * @return 橡皮鸭
     */
    @Override
    public Quack creatRubberDuck() {
        return new RubberDuck();
    }

    /**
     * 创建大鹅对象
     *
     * @return 大鹅
     */
    @Override
    public Quack creatGoose() {
        return new GooseAdapter(new Goose());
    }
}
